#include <gui/chippage_screen/ChipPageView.hpp>
#include <gui/chippage_screen/ChipPagePresenter.hpp>

ChipPagePresenter::ChipPagePresenter(ChipPageView& v)
    : view(v)
{

}

void ChipPagePresenter::activate()
{
		ChipPagePresenterState(true);
}

void ChipPagePresenter::deactivate()
{
		ChipPagePresenterState(false);
}
//更新芯片信息
void ChipPagePresenter::updateChipInfor(uint16_t newChipTempVal, uint16_t newVrefVal, uint16_t newVbatVal)
{
    view.updateChipInfor(newChipTempVal, newVrefVal, newVbatVal);
}
//ChipPagePresenter状态
void ChipPagePresenter::ChipPagePresenterState(bool enable)
{
	if(enable == true)
		model->ChipPageViewTask(true);
	else
		model->ChipPageViewTask(false);
}
//物理按键的页面跳转
void ChipPagePresenter::ChipPageChange(uint8_t newFiveKeyFunc)
{
		view.ChipPageChange(newFiveKeyFunc);	
}